const request = require("./http.js");

//短信发送
var getmessage = function (phone, callback) {
  request({
    url: "/mall/note/noteSend?phone=" + phone,
    method: "get",
    success: function (res) {
      callback(res);
    },
    fail: function (err) {
      console.log(err);
      wx.showToast({
        title: err.errMsg,
        icon: "none",
        duration: 2000,
      });
    },
  });
};

//短信验证
var getsmsJudge = function (data, callback) {
  request({
    url: "/mall/note/noteJudge",
    method: "post",
    data: data,
    success: function (res) {
      callback(res);
    },
    fail: function (err) {
      console.log(err);
      wx.showToast({
        title: err.errMsg,
        icon: "none",
        duration: 2000,
      });
    },
  });
};
module.exports = {
  getmessage: getmessage, //短信发送
  getsmsJudge: getsmsJudge, //短信验证
}